from django.db import models

# Create your models here.
# 原材料
class raw_material(models.Model):
    materialId = models.IntegerField(db_column="materialId",primary_key=True,null=False,unique=True)    # ID,唯一标识
    materialName = models.CharField(db_column="materialName",max_length=400,null=False,unique=True)     # 材料名称
    materialType = models.CharField(db_column="materialType",max_length=100)                            # 材料类型：采麻工专属、挖矿工专属、伐木工专属、普通材料
    materialAddress = models.CharField(db_column="materialAddress",max_length=100)                      # 资源产地
    addressLevel = models.CharField(db_column="addressLevel",max_length=200)                            # 资源产地等级
    childrenNames = models.CharField(db_column="childrenNames",max_length=1000)                         # 子材料名称
    childrenIds = models.CharField(db_column="childrenIds",max_length=200)                              # 子材料ID
    childrenNum = models.CharField(db_column="childrenNum",max_length=100)                              # 子材料数量
    materialImage = models.CharField(db_column="materialImage",max_length=400,null=True,unique=False)   # 图片

    class Meta:
        managed = True
        db_table = "raw_material"
